package com.ruoyi.hkCamera.utils;

import com.ruoyi.hkCamera.common.HCNetSDK;

import java.text.SimpleDateFormat;
import java.util.Date;

public class HcUtils {


    public static HCNetSDK.NET_DVR_TIME getHkTime(Date time) {
        HCNetSDK.NET_DVR_TIME structTime = new HCNetSDK.NET_DVR_TIME();
        String str = (new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss")).format(time);
        String[] times = str.split("-");
        structTime.dwYear = Integer.parseInt(times[0]);
        structTime.dwMonth = Integer.parseInt(times[1]);
        structTime.dwDay = Integer.parseInt(times[2]);
        structTime.dwHour = Integer.parseInt(times[3]);
        structTime.dwMinute = Integer.parseInt(times[4]);
        structTime.dwSecond = Integer.parseInt(times[5]);
        return structTime;
    }
}